import 'package:json_annotation/json_annotation.dart';
import 'package:mall/core/models/group_purchase_status.dart';

part 'group_history_res.g.dart';

@JsonSerializable()
class GroupHistoryRes {
  final int id;
  final bool allDisplayDetail; // 是否允许显示拼购详情
  final String createTime; // 创建时间
  final String deliveryStatus; // 拼购订单的发货状态
  final String disburse; // 拼购投入额度
  final String disburseUnit; // 单位
  final String income; // 拼购收入额度
  final String incomeUnit; // 单位
  final int modelInAreaId;
  final String orderCode; // 拼购商品的订单编码
  final String orderDesc; // 拼购订单说明
  final String portName; // 拼购窗口名
  final String productName; // 拼购商品名
  final String productPicture; // 拼购商品图片
  final String queueName; // 排队的队列名称
  final bool refund; // 未拼中商品后是否退费了
  final bool expired; // 是否已超时（超时会全额退款）
  final GroupPurchaseStatus status; // 拼购状态

  GroupHistoryRes(
    this.id,
    this.allDisplayDetail,
    this.createTime,
    this.deliveryStatus,
    this.disburse,
    this.disburseUnit,
    this.income,
    this.incomeUnit,
    this.modelInAreaId,
    this.orderCode,
    this.orderDesc,
    this.portName,
    this.productName,
    this.productPicture,
    this.queueName,
    this.refund,
    this.expired,
    this.status,
  );

  factory GroupHistoryRes.fromJson(Map<String, dynamic> json) => _$GroupHistoryResFromJson(json);

  Map<String, dynamic> toJson() => _$GroupHistoryResToJson(this);
}
